home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / raytrace / pov / patches / patch_ju.txt < prev    next >
Text File  |  1994-10-02  |  3KB  |  89 lines

  1.     Fractal sets patch. Second version.
  2.  
  3.     Bugs corrected:
  4.  
  5.     . Bounding slabs now work. Thank to Egon (egon@ugcs.caltech.edu) who
  6.     found the bug in 'lighting.c'. This correction may arrouse problems
  7.     with shadows one day, but until now, no one was detected. Well.
  8.  
  9.     . CSG is operational, but slows even more the computations. It
  10.     can be used optionaly.
  11.  
  12.     . The necessary file 'tokenize.c' was not included in the
  13.     previous archive. Unforgivable neglecting. 
  14.  
  15.                     Pascal.
  16. -----------------------------------------------------------------------
  17.  
  18.     julia_patch_2.tar contents and description:
  19.  
  20.     . 'frame.h'        ( new primitive fields )
  21.     . 'parse.h'        ( new tokens: julia, z3 and fractal )
  22.     . 'tokenize.c'        ( new tokens spelling )
  23.     . 'parse.c'        ( syntax )
  24.     . 'povproto.h'        ( prototype for routines in 'julia.c' )
  25.     . 'julia.c'        ( primitive routines )
  26.     . 'lighting.c'        ( Lines 269 and 270 have been changed to
  27.                   make bounding slabs work.)
  28.  
  29.     These files should replace those in the POV-ray 2.2 sources. Add
  30.     the primitive 'julia.c' in the Makefile before re-compiling.
  31.  
  32.     Syntax:
  33.  
  34.     <keyword> { C.x, C.y, C.z, C.w, n, s (,csg)
  35.             USUAL_TRANSFORMATIONS
  36.             USUAL_TEXTURES
  37.             ...
  38.     }
  39.  
  40.     where <keyword> is either: julia, z3 or fractal.
  41.  
  42.     The fractal is generated by taking the point (x,y,z,0.0) in
  43.     4D space (quaternion) and iterating a certain map, which depends
  44.     on the four parameters given by C.x, C.y, C.z and C.w.
  45.  
  46.     If, after n iterations, the iterated point did not get out of
  47.     the bounding sphere (radius=2), the initial point is in the set.
  48.  
  49.     For 'julia' set, the map is :     z -> z^2 + C
  50.     For 'z3' set, it is:        z -> z^3 + C
  51.     For 'fractal' set, the map is currently:
  52.  
  53.         | x        | x^2-y^2-z^2-w^2
  54.         | y        | 2*w*y    
  55.         | z    ---->    | 2*x*z              + C
  56.         | w        | 2*y*z
  57.  
  58.     but it can be changed at will in 'julia.c'. Look at routines:
  59.     'Iteration_Fractal' and 'Normal_Calc_Fractal'...
  60.  
  61.     The integer s gives the number of steps in which is a ray divided
  62.     in inside the sphere. Each point is tested, starting from eye,
  63.     until a likely intersection is detected. The higher s, the slower,
  64.     but smoother will look the set... 300 is commonly a good value.
  65.  
  66.     A better algo would use distance-estimator to perform the tests, 
  67.     and be much faster, but that does not work for any iteration map,
  68.     or when the initial point is *inside* the set. If someone wants to
  69.     enhance that point... I'll try when I find time :(
  70.  
  71.         csg: this keyword is optional and must be used when the fractal
  72.     set takes part in a CSG operation. Because, in such case, *all*
  73.     intersection points (or at least the MAX_INTERSECTIONS first
  74.     ones. Check in file 'parse.h' if problems) must be detected.
  75.     It is therefore much slower.
  76.  
  77.     Hope you'll enjoy, even if it is a slow primitive...
  78.  
  79.             Pascal.
  80.  
  81. ------------------------------
  82. Pascal Massimino
  83. Ecole Normale Superieure
  84. 45, rue d'Ulm
  85. 75005 Paris.
  86. Pascal.Massimino@ens.fr             (any comments/bugs/enhancements
  87.                 welcome )
  88. http://acacia.ens.fr:8080/home/massimin/index.ang.html
  89.